<template>
	<view>
		<cu-custom :bgImage="bgImg" :isBack="true">
			<view slot="content">百科</view>
		</cu-custom>

		<view class="flex justify-center">
			<image :src="info.image" style="width: 400rpx; height: 400rpx;"></image>
		</view>

		<view class="solid shadow margin-top-lg bg-white padding">
			<view class="margin-bottom-xs flex align-center">
				<u-icon name="error-circle-fill" color="#fa3534" size="40"></u-icon>
				<text class="text-lg text-black text-bold margin-left-xs">症状</text>
			</view>
			<view>猫癣，是指猫的皮肤病，多发部位在脸部、躯干，四肢和尾部等处，出现圆形或者椭圆形的的癣斑，上面覆有灰色的鳞屑，毛色会变得粗糙，癣斑部分的被毛一撮一撮脱落折断或者脱落。 被传染猫癣的猫有巨痒，所以经常会在各种物体上蹭痒。 病程较长，鳞屑脱落后，形成秃斑。 多见于营养不良和体弱多病的猫，增加营养特别是B族维生素的摄入，有利于预防该病和已染病猫的恢复。</view>
		</view>

		<view class="solid shadow margin-top-sm bg-white padding">
			<view class="margin-bottom-xs flex align-center">
				<u-icon name="error-circle-fill" color="#19be6b" size="40"></u-icon>
				<text class="text-lg text-black text-bold margin-left-xs">治疗方案</text>
			</view>
			<view>猫癣，是指猫的皮肤病，多发部位在脸部、躯干，四肢和尾部等处，出现圆形或者椭圆形的的癣斑，上面覆有灰色的鳞屑，毛色会变得粗糙，癣斑部分的被毛一撮一撮脱落折断或者脱落。 被传染猫癣的猫有巨痒，所以经常会在各种物体上蹭痒。 病程较长，鳞屑脱落后，形成秃斑。 多见于营养不良和体弱多病的猫，增加营养特别是B族维生素的摄入，有利于预防该病和已染病猫的恢复。</view>
		</view>
		
		<view class="footer row row-around align-center bg-white fixed full-width ">
				<button class="btn column-center" hover-class="none" @tap="shareDisease">
					<image class="icon-md" src="/static/share.png"></image>
					<text class="xxs lighter">分享</text>
				</button>
				<button class="btn column-center" hover-class="none" @tap="collectDiseas">
					<image class="icon-md" :src="is_collect==1 ? '/static/collect.png' : '/static/no_collect.png'"></image>
					<text class="xxs lighter">收藏</text>
				</button>
			<view class="btn column-center">
				<u-button type="primary" class="margin-left-sm" @click="goTakePhote">拍照诊断</u-button>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgImg: 'https://jiaoguanyi008.oss-cn-shenzhen.aliyuncs.com/miniPro/images/imgs/customBg.jpg',
				_id: '',
				info: {},
				is_collect: 0


			};
		},
		onLoad(params) {
			this._id = params._id
			console.log("这是id", this._id)
			this.getDiseaseInfoById()
		},
		methods: {
			async getDiseaseInfoById() {
				const { result: { code, msg, data } } = await wx.cloud.callFunction({ name: 'pet', data: { $url: 'getFirstDisease', queryData: { _id: this._id } } });
				if (code === 200) {
					this.info = data
				}
			},
			shareDisease() {
				console.log("这是分享")
			},
			collectDiseas() {
				
			},
			goTakePhote() {
				uni.switchTab({
					url: '/pages/index/index'
				});

			}
			
		}
	}
</script>

<style lang="scss">
	.footer {
		height: 100rpx;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		box-sizing: content-box;
		padding-bottom: env(safe-area-inset-bottom);

		.btn {
			width: 100rpx;
			height: 100rpx;
			position: relative;
			line-height: 1.3;
		}

		.cart-num {
			position: absolute;
			left: 60rpx;
			top: 6rpx;
		}

		.add-cart,
		.right-buy {
			flex: 1;
			text-align: center;
			padding: 16rpx 0;
		}

		.add-cart {
			background-color: #ffa630;
		}

		.right-buy {
			background-color: $-color-primary;
		}
	}
</style>